/**
 * 
 */
package cc.dogtailflower.framework.bean;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import cc.dogtailflower.framework.util.CollectionUtil;

/**
 * @author cc
 *
 */
public class Param {

	private List<FormParam> formParamList;

	public Param(List<FormParam> formParamList) {
		super();
		this.formParamList = formParamList;
	}
	
	/*
	 * 获取请求参数映射
	 */
	public Map<String,Object> getFieldMap(){
		Map<String,Object> fieldMap = new HashMap<String,Object>();
		if(CollectionUtil.isNotEmpty(formParamList)){
			for(FormParam formParam : formParamList){
				String fieldName = formParam.getFieldName();
				Object fieldValue = formParam.getFieldValue();
				fieldMap.put(fieldName, fieldValue);
			}
		
		}
		return fieldMap;
	}
	
	public boolean isEmpty(){
		return CollectionUtil.isEmpty(formParamList);
	}
}
